<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function delay() {
            return new Promise(resolve => {
                setTimeout(() => {
                    resolve(123);
                }, 1000);
            });
        }

        const result1 = (async ()=>{
            return {
                data: await delay(),
            }
        })();

        console.log(result1);

        const result2 = (() => {
            return new Promise(resolve => {
                delay().then(data=>{
                    resolve({
                        data
                    });
                });
            })
        })();

        console.log(result2);
    </script>
</body>

</html>